﻿using System;

namespace CalculatorLib
{
    public class MathLib
    {
        //Adds two numbers
        public int Add(int addend1, int addend2)
        {
            return addend1 + addend2;
        }

        //Subtract two numbers
        public int Subtract(int minuend, int subtrahend)
        {
            return minuend  - subtrahend;
        }

        //Multiplies two numbers
        public int Multiply(int multiplicand, int multiplier)
        {
            return multiplicand * multiplier;
        }

        //Should multiply two numbers
        //This method is wrong on purpose
        //public int Multiply(int multiplicand, int multiplier)
        //{
        //    return multiplicand + multiplier;
        //}

        //Divide two numbers
        public float Divide (float dividend, float divisor)
        {
            if (divisor==0)
                throw new DivideByZeroException();
            return dividend/divisor;
        }
    }
}
